package com.whmnx.main.ui.model;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.whmnx.base.bean.PingTanBean;
import com.whmnx.base.constants.Constants;
import com.whmnx.main.ui.fragment.CanTeamDetailsFragment;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

/**
 * author : huang
 * date   : 2020/9/28 0028 16:14
 * version: 1.0
 * @author Administrator
 */
public class ComDetailsItemViewModel extends ItemViewModel {

    public String imgUrl;
    public ObservableField<String> tv_num = new ObservableField<>("");
    public ObservableField<String> tv_time = new ObservableField<>("");

    public ComDetailsItemViewModel(@NonNull BaseViewModel viewModel, PingTanBean pingTanBean) {
        super(viewModel);
        this.imgUrl = Constants.HOST + pingTanBean.getGroupUserModel().get(0).getUserInfo_Image();
        tv_num.set("还差" + pingTanBean.getGlang() + "人成团");
    }

    public ObservableField<String> Product_sec  = new ObservableField<>("");

    public ObservableField<String> Product_price  = new ObservableField<>("");






    //去参团
    public BindingCommand OnClickCommand = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            viewModel.startContainerActivity(CanTeamDetailsFragment.class.getCanonicalName());
        }
    });
}
